﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Facebook.Api
{
    public enum ApplicationMetricPeriodType : long
    {
        Day = 86400,
        Week = 604800,
        Month = 2592000
    }

    public struct ApplicationMetricPeriod
    {
        public ApplicationMetricPeriod(ApplicationMetricPeriodType type)
            : this()
        {
            this.Value = (Int64)type;
        }

        public Int64 Value { get; private set; }

        public static ApplicationMetricPeriod FromType(ApplicationMetricPeriodType type)
        {
            return new ApplicationMetricPeriod(type);
        }

        public static implicit operator Int64(ApplicationMetricPeriod value)
        {
            return value.Value;
        }

        public static implicit operator ApplicationMetricPeriod(ApplicationMetricPeriodType type)
        {
            return ApplicationMetricPeriod.FromType(type);
        }
    }
}